/*
 * Entry.java
 * 
 * Created on 19-jun-2007, 20:51:28
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.i2a.peacsy.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Tortuga
 */
@Entity
@Table(name = "TA_ENTR_ENTRIES")
@NamedQueries({@NamedQuery(name = "Entry.findByEntrCoCode", query = "SELECT e FROM Entry e WHERE e.entrCoCode = :entrCoCode"), @NamedQuery(name = "Entry.findByEntrLiDescription", query = "SELECT e FROM Entry e WHERE e.entrLiDescription = :entrLiDescription"), @NamedQuery(name = "Entry.findByAudiInSituation", query = "SELECT e FROM Entry e WHERE e.audiInSituation = :audiInSituation"), @NamedQuery(name = "Entry.findByAudiDaCreationDate", query = "SELECT e FROM Entry e WHERE e.audiDaCreationDate = :audiDaCreationDate"), @NamedQuery(name = "Entry.findByAudiLiCreationUsr", query = "SELECT e FROM Entry e WHERE e.audiLiCreationUsr = :audiLiCreationUsr"), @NamedQuery(name = "Entry.findByAudiDaUpdateDate", query = "SELECT e FROM Entry e WHERE e.audiDaUpdateDate = :audiDaUpdateDate"), @NamedQuery(name = "Entry.findByAudiLiUpdateUsr", query = "SELECT e FROM Entry e WHERE e.audiLiUpdateUsr = :audiLiUpdateUsr")})
public class Entry implements Serializable {

  @Id
  @Column(name = "ENTR_CO_CODE", nullable = false)
  private Integer entrCoCode;

  @Column(name = "ENTR_LI_DESCRIPTION")
  private String entrLiDescription;

  @Column(name = "AUDI_IN_SITUATION")
  private Short audiInSituation;

  @Column(name = "AUDI_DA_CREATION_DATE")
  @Temporal(TemporalType.TIMESTAMP)
  private Date audiDaCreationDate;

  @Column(name = "AUDI_LI_CREATION_USR")
  private String audiLiCreationUsr;

  @Column(name = "AUDI_DA_UPDATE_DATE")
  @Temporal(TemporalType.TIMESTAMP)
  private Date audiDaUpdateDate;

  @Column(name = "AUDI_LI_UPDATE_USR")
  private String audiLiUpdateUsr;

  @JoinColumn(name = "CONC_CO_CODE", referencedColumnName = "CONC_CO_CODE")
  @ManyToOne
  private Concept concCoCode;

  @JoinColumn(name = "MOVE_CO_CODE", referencedColumnName = "MOVE_CO_CODE")
  @ManyToOne
  private Movement moveCoCode;
    protected static org.apache.commons.logging.Log
        log = org.apache.commons.logging.LogFactory.getLog(Entry.class);

    public Entry() {
    }

  public Entry(Integer entrCoCode) {
    this.entrCoCode = entrCoCode;
  }

  public Integer getEntrCoCode() {
    return entrCoCode;
  }

  public void setEntrCoCode(Integer entrCoCode) {
    this.entrCoCode = entrCoCode;
  }

  public String getEntrLiDescription() {
    return entrLiDescription;
  }

  public void setEntrLiDescription(String entrLiDescription) {
    this.entrLiDescription = entrLiDescription;
  }

  public Short getAudiInSituation() {
    return audiInSituation;
  }

  public void setAudiInSituation(Short audiInSituation) {
    this.audiInSituation = audiInSituation;
  }

  public Date getAudiDaCreationDate() {
    return audiDaCreationDate;
  }

  public void setAudiDaCreationDate(Date audiDaCreationDate) {
    this.audiDaCreationDate = audiDaCreationDate;
  }

  public String getAudiLiCreationUsr() {
    return audiLiCreationUsr;
  }

  public void setAudiLiCreationUsr(String audiLiCreationUsr) {
    this.audiLiCreationUsr = audiLiCreationUsr;
  }

  public Date getAudiDaUpdateDate() {
    return audiDaUpdateDate;
  }

  public void setAudiDaUpdateDate(Date audiDaUpdateDate) {
    this.audiDaUpdateDate = audiDaUpdateDate;
  }

  public String getAudiLiUpdateUsr() {
    return audiLiUpdateUsr;
  }

  public void setAudiLiUpdateUsr(String audiLiUpdateUsr) {
    this.audiLiUpdateUsr = audiLiUpdateUsr;
  }

  public Concept getConcCoCode() {
    return concCoCode;
  }

  public void setConcCoCode(Concept concCoCode) {
    this.concCoCode = concCoCode;
  }

  public Movement getMoveCoCode() {
    return moveCoCode;
  }

  public void setMoveCoCode(Movement moveCoCode) {
    this.moveCoCode = moveCoCode;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (entrCoCode != null ? entrCoCode.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof Entry)) {
      return false;
    }
    Entry other = (Entry) object;
    if (this.entrCoCode != other.entrCoCode && (this.entrCoCode == null || !this.entrCoCode.equals(other.entrCoCode))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "org.i2a.peacsy.entity.Entry[entrCoCode=" + entrCoCode + "]";
  }

}
